Namespace Ventas
Public Class Comprobante
	Inherits Auditoria.Transaccion

	Private vComprobanteId As Integer = -1
	Private vCodigo As String = ""
	Private vFecha As Long = 0
	Private vClienteId As Integer = -1
	Private vClienteNombre As string =""
	Private vClienteObs As String = ""
	Private vTipoId As Integer = -1
	Private vTipoNombre As string =""
	Private vSerie As String = ""
	Private vNro As String = ""
	Private vPagoTipoId As Integer = -1
	Private vPagoTipoNombre As string =""
	Private vSubTotal As Double = 0.0
	Private vTotalDescuento As Double = 0.0
	Private vIGv As Double = 0.0
	Private vRedondeo As Double = 0.0
	Private vTotal As Double = 0.0
	Private vCantidad As Integer = -1
	Private vEstado As Integer = -1

	Public Property ComprobanteId() As Integer
		Get
			Return vComprobanteId
		End Get
		Set(ByVal Value As Integer)
			vComprobanteId = Value
		End Set
	End Property

	Public Property Codigo() As String
		Get
			Return vCodigo
		End Get
		Set(ByVal Value As String)
			vCodigo = Value
		End Set
	End Property

	Public Property Fecha() As Long
		Get
			Return vFecha
		End Get
		Set(ByVal Value As Long)
			vFecha = Value
		End Set
	End Property

	Public readonly  Property FechaStr() as string
		Get
			Return System.DateTime.FromFileTime(Fecha).ToShortDateString
		End Get
	End Property

	Public Property ClienteId() As Integer
		Get
			Return vClienteId
		End Get
		Set(ByVal Value As Integer)
			vClienteId = Value
		End Set
	End Property

	Public Property ClienteNombre() as string
		Get
			Return vClienteNombre
		End Get
		Set(ByVal Value As string)
			vClienteNombre = Value
		End Set
	End Property

	Public Property ClienteObs() As String
		Get
			Return vClienteObs
		End Get
		Set(ByVal Value As String)
			vClienteObs = Value
		End Set
	End Property

	Public Property TipoId() As Integer
		Get
			Return vTipoId
		End Get
		Set(ByVal Value As Integer)
			vTipoId = Value
		End Set
	End Property

	Public Property TipoNombre() as string
		Get
			Return vTipoNombre
		End Get
		Set(ByVal Value As string)
			vTipoNombre = Value
		End Set
	End Property

	Public Property Serie() As String
		Get
			Return vSerie
		End Get
		Set(ByVal Value As String)
			vSerie = Value
		End Set
	End Property

	Public Property Nro() As String
		Get
			Return vNro
		End Get
		Set(ByVal Value As String)
			vNro = Value
		End Set
	End Property

	Public Property PagoTipoId() As Integer
		Get
			Return vPagoTipoId
		End Get
		Set(ByVal Value As Integer)
			vPagoTipoId = Value
		End Set
	End Property

	Public Property PagoTipoNombre() as string
		Get
			Return vPagoTipoNombre
		End Get
		Set(ByVal Value As string)
			vPagoTipoNombre = Value
		End Set
	End Property

	Public Property SubTotal() As Double
		Get
			Return vSubTotal
		End Get
		Set(ByVal Value As Double)
			vSubTotal = Value
		End Set
	End Property

	Public Property TotalDescuento() As Double
		Get
			Return vTotalDescuento
		End Get
		Set(ByVal Value As Double)
			vTotalDescuento = Value
		End Set
	End Property

	Public Property IGv() As Double
		Get
			Return vIGv
		End Get
		Set(ByVal Value As Double)
			vIGv = Value
		End Set
	End Property

	Public Property Redondeo() As Double
		Get
			Return vRedondeo
		End Get
		Set(ByVal Value As Double)
			vRedondeo = Value
		End Set
	End Property

	Public Property Total() As Double
		Get
			Return vTotal
		End Get
		Set(ByVal Value As Double)
			vTotal = Value
		End Set
	End Property

	Public Property Cantidad() As Integer
		Get
			Return vCantidad
		End Get
		Set(ByVal Value As Integer)
			vCantidad = Value
		End Set
	End Property

	Public Property Estado() As Integer
		Get
			Return vEstado
		End Get
		Set(ByVal Value As Integer)
			vEstado = Value
		End Set
	End Property

	Sub New()
	End Sub

	Sub New(ByRef ComprobanteId As Integer, ByVal Codigo As String, ByVal Fecha As Long, ByVal ClienteId As Integer, ByVal ClienteObs As String, ByVal TipoId As Integer, ByVal Serie As String, ByVal Nro As String, ByVal PagoTipoId As Integer, ByVal SubTotal As Double, ByVal TotalDescuento As Double, ByVal IGv As Double, ByVal Redondeo As Double, ByVal Total As Double, ByVal Cantidad As Integer, ByVal estado As Integer)
		vComprobanteId = ComprobanteId
		vCodigo = Codigo
		vFecha = Fecha
		vClienteId = ClienteId
		vClienteObs = ClienteObs
		vTipoId = TipoId
		vSerie = Serie
		vNro = Nro
		vPagoTipoId = PagoTipoId
		vSubTotal = SubTotal
		vTotalDescuento = TotalDescuento
		vIGv = IGv
		vRedondeo = Redondeo
		vTotal = Total
		vCantidad = Cantidad
		vEstado = Estado
	End Sub

End Class



 Public Class ComprobanteCol   
 Inherits System.Collections.CollectionBase
Private _enmSortDirection As SortDirection
Public Sub New()
_enmSortDirection = SortDirection.Asc
End Sub
Public Sub Sort(ByVal sortExpression As String, ByVal sortDirection As SortDirection)
InnerList.Sort(New Comparer(sortExpression, SortDirection))
End Sub
Public Sub Sort(ByVal sortExpression As String)
InnerList.Sort(New Comparer(sortExpression, _enmSortDirection))
If _enmSortDirection = SortDirection.Asc Then
_enmSortDirection = SortDirection.Desc
Else
_enmSortDirection = SortDirection.Asc
End If
End Sub
Public Function Add(ByVal obj As Comprobante) As Integer
Return MyBase.List.Add(obj)
End Function
Public Sub AddPrimero(ByVal obj As Comprobante)
MyBase.List.Insert(0, obj)
End Sub
Public ReadOnly Property Comprobante(ByVal Index As Integer) As Comprobante
Get
Return CType(MyBase.List(Index), Comprobante)
End Get
End Property
End Class
end namespace

